package com.hnkywl.sts.entity.cggl;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.cggl.*;
import com.hnkywl.sts.entity.organ.Gsjg;
import com.hnkywl.sts.entity.organ.Qyjg;
import com.hnkywl.sts.entity.sys.Yg;
import com.hnkywl.sts.entity.xsgl.Xsd;
import com.hnkywl.sts.entity.xsgl.Xsmx;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: ZHUCHG
 * Date: 13-4-15
 * Time: 下午4:27
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "T_BIZ_JSDHB")
@Where(clause = "deleted!='1'")
public class Jsdhb extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqJsdhb", allocationSize = 1, sequenceName = "SEQ_BIZ_JSDHB")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqJsdhb")
    private Long id;

    @OneToMany(cascade = CascadeType.MERGE,fetch = FetchType.LAZY, targetEntity = Jsd.class)
    @JoinColumn(name = "JSDHB_ID")
    private List<Jsd> jsdList;

    //合并单号
    private Integer hbdh;

    //合并日期
    private Date hbrq;

    //合并人
    @ManyToOne
    @JoinColumn(name="HBR_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Yg hbr;

    //会计区间
    private Integer kjqj;



    /**
     * 会计年
     */
    @Column(name = "jiuqi_acctyear")
    private Integer acctyear;
    /**
     * 生成久其凭证时提供的ID
     */
    @Column(name = "jiuqi_uuid")
    private String uuid;
    /**
     * 久其返回的凭证ID
     */
    @Column(name = "jiuqi_voucher_id")
    private String voucherId;
    /**
     * 久其返回的凭证号
     */
    @Column(name = "jiuqi_voucher_num")
    private Integer voucherNum;
    /**
     * “久其插入标示”代码   1=未导入,2=导入开始,3=导入成功
     */
    @Column(name = "jiuqi_insert_flag")
    private Integer insertFlag = 1;
    /**
     * "久其删除标示”代码   1=未删除,2=删除开始,3=删除成功
     */
    @Column(name = "jiuqi_delete_flag")
    private Integer deleteFlag = 1;


    //公司
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "GS_ID")
    private Gsjg gs;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public List<Jsd> getJsdList() {
        return jsdList;
    }

    public void setJsdList(List<Jsd> jsdList) {
        this.jsdList = jsdList;
    }

    public Integer getHbdh() {
        return hbdh;
    }

    public void setHbdh(Integer hbdh) {
        this.hbdh = hbdh;
    }

    public Date getHbrq() {
        return hbrq;
    }

    public void setHbrq(Date hbrq) {
        this.hbrq = hbrq;
    }

    public Yg getHbr() {
        return hbr;
    }

    public void setHbr(Yg hbr) {
        this.hbr = hbr;
    }

    public Integer getKjqj() {
        return kjqj;
    }

    public void setKjqj(Integer kjqj) {
        this.kjqj = kjqj;
    }


    public Gsjg getGs() {
        return gs;
    }

    public void setGs(Gsjg gs) {
        this.gs = gs;
    }

    public Integer getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    public Integer getInsertFlag() {
        return insertFlag;
    }

    public void setInsertFlag(Integer insertFlag) {
        this.insertFlag = insertFlag;
    }

    public Integer getVoucherNum() {
        return voucherNum;
    }

    public void setVoucherNum(Integer voucherNum) {
        this.voucherNum = voucherNum;
    }

    public String getVoucherId() {
        return voucherId;
    }

    public void setVoucherId(String voucherId) {
        this.voucherId = voucherId;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public Integer getAcctyear() {
        return acctyear;
    }

    public void setAcctyear(Integer acctyear) {
        this.acctyear = acctyear;
    }
}
